import { configureStore } from '@reduxjs/toolkit'
import { countSlice } from '@/store/modules/count'

// 创建store对象
const store = configureStore({
  // 合并所有的reducer
  reducer: {
    count: countSlice.reducer,
  },
})

store.subscribe(() => {
  // 这里可以获取到状态最新的数据
  console.log('subscribe', store.getState())
})

// 导出store对象
export default store
